<?php
	if (!isset($_SESSION)) {
		session_start();
	} 
	
	//OBTENEMOS EL HTML
	ob_start();
	include __DIR__."/../includes/var_globals.php";
	require_once(dirname(__FILE__).'/../clases/db.class.php');
    include(dirname(__FILE__).'/../controller/estado_resultado.controller.php');
	$content = ob_get_clean();
	
	//Conversion a PDF
	require_once(dirname(__FILE__).'/../libs/html2pdf/html2pdf.class.php');
    try
    {
        $html2pdf = new HTML2PDF('P', 'LETTER', 'es', true, 'UTF-8', 15);
        $html2pdf->pdf->SetDisplayMode('fullpage');
		$html2pdf->pdf->SetBooklet(true, 10, 30);
        $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
        $html2pdf->Output('EstadoResultado.pdf');
    }
    catch(HTML2PDF_exception $e) {
        echo $e;
        exit;
    }	
?>